package com.auto.api.core.type.json.yapi;

import com.auto.api.core.type.json.AbstractTypeHandler;
import com.auto.api.core.type.json.JsonTypeHandler;
import java.util.HashMap;
import java.util.Map;
import org.springframework.core.ResolvableType;

/**
 * @program:
 * @description: 类型转换接口
 * @author: liangshf
 * @create: 2020-09-24
 */
public abstract class AbstractResultJsonTypeHandler extends AbstractTypeHandler<Map> implements JsonTypeHandler {

    @Override
    public Map getResultInstance() {
        return new HashMap();
    }

    /**
     * 根据类型获取默认Json
     * @return
     */
    @Override
    public String doResultJson(ResolvableType resolvableType, Map jsonObject){
        return getResultJson(resolvableType, jsonObject);
    }

    public abstract String getResultJson(ResolvableType resolvableType, Map jsonObject);

}
